import os
from typing import List

import pymysql


class Config:
    SECRET_KEY = 'your-secret-key-here'
    DEBUG = True

    # 吉客云API配置
    JIKEYUN_APP_KEY = os.getenv('JIKEYUN_APP_KEY', '12540443')
    JIKEYUN_APP_SECRET = os.getenv('JIKEYUN_APP_SECRET', 'a7860451c1b6470da900bd40d91addb2')

    # 仓库ID配置 - 排除一件代发仓
    WAREHOUSE_IDS: List[str] = [
        "1336070890133324544", "743255118019625856", "743255118128677760", "1417239991126099712",
        "1986443614567170560", "2068841910925919232", "1920407559764902400", "1964561067655692800",
        "2208016583559939456", "2202392778890937856", "2200186645209351040", "2200186641166041984",
        "2200186632039236480", "2200186636594250624", "2200186627115123584", "2200186620437791616",
        "2200186612082738048", "2200186603778016128", "2187742358607823104", "2187694686379836544",
        "2181416842340533888", "2181416325770053248", "2173325962101293952", "2170479451046217472",
        "2170432319370724608", "2170307271536740096", "2158943111372244224", "2158942078266836096",
        "2158930682542195968", "2158927911986300160", "2148746470579437824", "2128314708271105792",
        "2124676649520923776", "2122494971476248192", "2120649486729381120", "2252425840237413376",
        "2112540702796873984", "2109664993634814464", "2103041129078129920", "2101003695678195072",
        "2099523790783284608", "2093503182696286080", "2092786234173489920", "2092039419363264256",
        "2091497826654815232", "2087076535149167360", "2083500816324167040", "2083500466602148992",
        "2083498984839774592", "2082738907052311936", "2082107296143705344", "2081232078274200064",
        "2073928802906276608", "2073406285774981120", "2071923154067817088", "2069089932444338048",
        "2068254008513725056", "2064942437610357248", "2060854904866374144", "2058939255752558464",
        "2056569698050279552", "2048636352525961472", "2048094649792529024", "2047317693519792128",
        "2043443863122937728", "2039289456388540288", "2039200520004863872", "2037735172584833408",
        "2036967797411448704", "2032594137851495296", "2030767087823292288", "2029400904921155072",
        "2029200573546170112", "2029173442505246208", "2029125719866672000", "2028417987521609984",
        "2026920165257315968", "2026303999190107008", "2023963651698001536", "2018222206859740160",
        "2017836176524575744", "2017438930167531392", "2016159862624256896", "2015228285811589376",
        "2014630275881797376", "2012823398366642688", "2012819020383682816", "2005407668229768320",
        "2005396093774660224", "2004663147954080000", "2002168044857919872", "1992969049087017600",
        "1989986473105098880", "1987813258947789056", "1986448481069106304", "1986445822683677184",
        "1985680223205458688", "1984253834350723968", "1977098091512071296", "1970325698298316032",
        "1967424274042127232", "1967398617954321280", "1967371151917515136", "1966734138831406208",
        "1955858059988207488", "1955064187267745664", "1950827615111807744", "1947206852520313984",
        "1946558060365153536", "1942127174206949632", "1940604795937293184", "1938499502388184576",
        "1921679199118885504", "1921678607822684800", "1921678013380756096", "1921676447070880000",
        "1737602652568126976", "1633949968465756800", "1627522238705140992", "1194223064054530432",
        "2245093882992657920", "2116802196736378880,2237244481946419456,2252427003294975744", "2260905889485883520",
        "2252425840237413376", "2239403952151888768"
    ]

    @classmethod
    def get_warehouse_ids_string(cls) -> str:
        """获取仓库ID字符串，用逗号分隔"""
        return ",".join(cls.WAREHOUSE_IDS)


def DB():
    return pymysql.connect(
        host="rm-2zer2f33rws29ogb1do.mysql.rds.aliyuncs.com",
        port=3306,
        user="zxy",
        password="zxy@800901",
        database="ruoyi",
        charset='utf8mb4',
        use_unicode=True
    )


def DB_ZXY():
    return pymysql.connect(
        host="rm-2zer2f33rws29ogb1do.mysql.rds.aliyuncs.com",
        port=3306,
        user="zxy",
        password="zxy@800901",
        database="zxy",
        charset='utf8mb4',
        use_unicode=True
    )
